<template>
	
	<view >
		<swiper class="swiper">
				<swiper-item >
						<view>
							<div style="overflow-y: auto;"  id="main"></div>
						</view>
				</swiper-item>
				<swiper-item>
						<view>B</view>
				</swiper-item>
 
		</swiper>
	</view>
	
	
</template>

<script>
	// Import the echarts core module, which provides the necessary interfaces for using echarts.
	import * as echarts from 'echarts/core';
	// Import bar charts, all with Chart suffix
	import {
	    BarChart,
			LineChart
	} from 'echarts/charts';
	// import the tooltip, title, and rectangular coordinate system components, all suffixed with Component
	import {
	    TitleComponent,
	    TooltipComponent,
	    GridComponent,
			LegendComponent
	} from 'echarts/components';
	// Import the Canvas renderer, note that introducing the CanvasRenderer or SVGRenderer is a required step
	import {
	    CanvasRenderer
	} from 'echarts/renderers';
	
	// Register the required components
	echarts.use(
	    [TitleComponent, TooltipComponent, GridComponent, BarChart, CanvasRenderer,LineChart,LegendComponent]
	);	

	export default {
		data() {
			return {
				currentTabIndex : 0,
			 
			}
		},
		onLoad() {
	
		},
		mounted() {
			this.drawLine();
		},
		methods: {
			drawLine() {
				let myChart = echarts.init(document.getElementById('main'));
				let option = {
				    xAxis: {
				        type: 'category',
				        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
								axisLine:{
										 show:true,  //这里的show用于设置是否显示y轴那一条线 默认为true
										 lineStyle:{ //lineStyle里面写y轴那一条线的样式					  
											 width: 1,    //轴线的粗细 我写的是2 最小为0，值为0的时候线隐藏
										 }
								 }
				    },
				    yAxis: {
							min:0,
							max:20,
							interval: 5,
							name: '平均值',
				        type: 'value',
								nameTextStyle: {
									align: 'right'
								},
								axisLine:{
										 show:true,  //这里的show用于设置是否显示y轴那一条线 默认为true
										 lineStyle:{ //lineStyle里面写y轴那一条线的样式					  
											 width: 1,    //轴线的粗细 我写的是2 最小为0，值为0的时候线隐藏
										 }
								 }
				    },
				    series: [{
				        data: [5, 15, 13, 7, 12, 9, 17],
				        type: 'line'
				    }]
				};
				
				option && myChart.setOption(option);
				 
			}
		}
	}
	
</script>

<style>
	#main {
		width: 100%;
		height: 450rpx;
	}
</style>
